<?php

namespace App\Models;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\SoftDeletes;

class MusicCreation extends Common
{
    use SoftDeletes;

    protected $guarded = [];

    /**
     * 类别表
     */
    protected $table = 'rap_music_creation';
    public      $timestamps = false;

    /**
     * 允许批量赋值的字段
     * */
    protected $fillable = [];

    /**
     * 隐藏字段
     * */
    protected $hidden = [];
    /**
     * 获取该评论所属的文章模型。
     */
    public function beat()
    {
        return $this->belongsTo('App\Models\Beat','beat_id','id');
    }

    public function user()
    {
        return $this->belongsTo('App\Models\WxUsers','user_id','id');
    }
    /**
     * @param array $where
     * @return array
     * @name 根据条件获取一条数据
     * @user IHammer
     */
    public static function getInfo($where=array()){
        $res = self::where($where)->first();
        if($res){
            return $res->toArray();
        }
        return [];
    }

}
